package com.golxen.framework.common.server.game;


import com.golxen.framework.activity.ActivityReloadTask;
import com.golxen.framework.executor.GeneralTask;
import com.golxen.framework.user.player.PlayerDataDailyResetTask;
import com.golxen.utils.LogUtil;
import com.mysql.cj.util.LogUtils;
import org.apache.commons.lang3.StringUtils;

public class DailyTask extends GeneralTask {

    @Override
    public void doRun() {

        LogUtil.COMMON.info("============每日重置开始++++++++++");
        long a = System.currentTimeMillis();
        try {
            new PlayerDataDailyResetTask().run();
        } catch (Throwable t) {
            LogUtil.COMMON.error(StringUtils.EMPTY, t);
        }
        long b = System.currentTimeMillis();
        LogUtil.COMMON.info("=========每日重置玩家 {}ms", (b - a));

        try {
            new ActivityReloadTask().run();
        } catch (Throwable t) {
            LogUtil.COMMON.error(StringUtils.EMPTY, t);
        }
        long c = System.currentTimeMillis();
        LogUtil.COMMON.info("=========每日重置活动 {}ms", (c - b));

        LogUtil.COMMON.info("============每日重置结束++++++++++ {}ms", (c - a));
    }

}
